import { ref, reactive, provide } from 'vue'
import useSearch from './useSearch'

let data = ref([])

let search_form = reactive({
  keyword: '',
  type: '',
  sort: '',
  location: '',
})

const { search } = useSearch()

const copy = () => {
  console.log('copy---')
}

export default function useInit() {
  provide('search_form', search_form)
  provide('search', search)
  provide('copy', copy)

  return {
    data,
    search_form,
    search,
  }
}
